<!--编辑菜单-->
<div class="dialog_content">
    <form id="info_form" name="info_form" action="{:url('Menu/editDo')}" method="post">
    <table width="100%" class="table_form">
        <tr>
            <th width="100">上级菜单 :</th>
            <td>
            <select name="pid">
                <option value="0">作为一级菜单</option>
                {$select_menus}
            </select>
          </td>
        </tr>
        <tr>
        <th>菜单名称 :</th>
            <td><input type="text" name="name" id="name" class="input-text" value="{$info.name}"></td>
        </tr>
        <tr>
            <th>控制器名 :</th>
            <td><input type="text" name="module_name" id="module_name" class="input-text" value="{$info.module_name}"></td>
        </tr>
        <tr>
            <th>方法名 :</th>
            <td><input type="text" name="action_name" id="action_name" class="input-text" value="{$info.action_name}"></td>
        </tr>
        <tr> 
            <th>附加参数 :</th>
            <td><input type="text" name="data" id="data" class="input-text" value="{$info.data}"></td>
        </tr>
        <tr>
            <th>备注 :</th>
            <td><textarea name="remark" id="remark" cols="40" rows="3">{$info.remark}</textarea></td>
        </tr>
        <tr>
            <th>添加到常用菜单 :</th>
            <td>
                <label><input type="radio" name="often" class="radio_style" value="1" {if condition="$info['often'] eq 1"}checked="checked"{/if}> 是&nbsp;&nbsp;</label>
                <label><input type="radio" name="often" class="radio_style" value="0" {if condition="$info['often'] eq 0"}checked="checked"{/if}> 否</label>
            </td>
        </tr>
        <tr>
            <th>是否显示菜单 :</th>
            <td>
                <label><input type="radio" name="display" class="radio_style" value="1" {if condition="$info.display eq 1"}checked="checked"{/if}> 是&nbsp;&nbsp;</label>
                <label><input type="radio" name="display" class="radio_style" value="0" {if condition="$info.display eq 0"}checked="checked"{/if}> 否</label>
            </td>
        </tr>
    </table>
    <input name="id" type="hidden" value="{$info.id}">
    </form>
</div>
<script>
$(function(){
    $.formValidator.initConfig({formid:"info_form",autotip:true});

    $("#name").formValidator({ onshow:'填写菜单名称', onfocus:'填写菜单名称', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写菜单名称'}).defaultPassed();
    $("#module_name").formValidator({ onshow:'填写控制器名', onfocus:'填写控制器名', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写控制器名'}).defaultPassed();
    $("#action_name").formValidator({ onshow:'填写方法名', onfocus:'填写方法名', oncorrect:'正确'}).inputValidator({ min:1, onerror:'填写方法名'}).defaultPassed();

    $('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.yingloujie.tip({content:result.msg});
            setTimeout(function(){window.location.reload();},1000);
        } else {
            $.yingloujie.tip({content:result.msg, icon:'alert'});
        }
    }
});
</script>